package com.usian.mapper;

import com.usian.pojo.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface CourseMapper {

    @Select("select * from course")
    public List<Course> findAll();

    @Select("select * from course where id = #{id}")
    public Course findById(@Param("id") Integer id);

    public void insertCourse(Course course);

    @Delete("delete from course where id = #{id}")
    public void deleteById(@Param("id") Integer id);

    //@Update("update course set name=#{name},sex=#{sex},age=#{age},birthday=#{birthday},Chinese=#{Chinese},Math=#{Math},English=#{English} where id=#{id}")
    public void update(Course course);
}
